/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 雷世雄爸爸
 * Date: 2021-11-07
 * Time: 19:31
 */
public class TestDemo {
    public static void main(String[] args) {
        MyTreeNode myTreeNode=new MyTreeNode();
        TreeNode root = myTreeNode.createTree();
//        System.out.println(myTreeNode.qianxubainli(root));
        System.out.println("前序遍历：");
        System.out.println(myTreeNode.preorderTraversal2(root));
        System.out.println("中序遍历：");
        myTreeNode.zhongxubianli2(root);
        System.out.println();
        System.out.println("后序遍历：");
        myTreeNode.houxubianli(root);
        System.out.println();
        System.out.println("求节点个数：");
        System.out.println(myTreeNode.getSize1(root));
        System.out.println(myTreeNode.getSize2(root));
        System.out.println("求叶子节点个数：");
        System.out.println(myTreeNode.getLeafsize1(root));
        System.out.println(myTreeNode.getLeafsize2(root));
        System.out.println("求第K层节点的个数：");
        System.out.println(myTreeNode.getKLevelSize(root, 3));
        System.out.println("查找节点");
        System.out.println(myTreeNode.find(root, 'H').val);
        System.out.println("层序遍历：");
        myTreeNode.levelOrderTraversal(root);
    }
}
